package aoi.movieweb.repository;

import aoi.movieweb.model.Movie;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface MovieRepository extends JpaRepository<Movie, Long> {


    //根据标题查找电影
    List<Movie> findByTitle(String title);
    //根据导演查找电影
    List<Movie> findByDirector(String director);

    //根据发布日期查找电影
    List<Movie> findByReleaseDateAfter(Date releaseDate);

    //根据标题包含的关键词查找电影
    List<Movie> findByTitleContaining(String keyword);

}
